package com.chen.service.impl;

import com.chen.dao.UserDao;
import com.chen.pojo.User;
import com.chen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao userDao;

    @Override
    public User checkUser(String name, String password) {
        return userDao.findByUsernameAndPassword(name, DigestUtils.md5DigestAsHex(password.getBytes()));
    }
}
